home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_olv_wallblast.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
6KB
|
237 lines
# Jones 3D Cog Script
#
# olv_wallblast.cog
#
# Cog description
#
# [DS & RD]
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ===================================================================
symbols
message startup
message activated
message damaged
message pulse
surface crackedwall mask=0x408
sound explosion=imp1_wall_break.wav local
sound sfxCharge=imp1_chargeup.wav local
sound indysay=inxj025.wav local #This wall looks ready to crumble.
thing bombpos local
thing dust local
thing player local
template dusttemp=dustcloud local
template debris=stnshrapas_nc_ns local
template bomb=ghost local
material dustmat=gen_a4sfx_dustcloud.mat local
int fragment=0 local
int i=0 local
int vibe local
int speak0 local
flex blowitup local
vector angoffset local
vector posoffset local
# .............. INDY SAY LINES ..................................................
int lineindex local # indexes sound array
# wrong item...
sound in_itemline0=Inxj089.wav local # That didn't work.
sound in_itemline1=Inxj090.wav local # ...something wrong.
sound in_itemline2=Inxj092.wav local # Hmm...didn't quite work.
sound in_itemline3=Inxj060.wav local # I don't think...right answer.
sound in_itemline4=Inxj087.wav local # Whoops.
sound in_itemline5=Inxj088.wav local # Nope.
sound in_itemline6=Inxj091.wav local # Of course that didn't work.
int wi_newline=50 local
int wi_oldline=50 local
flex randwrongitemlines local
int wrongitemoffset local
end
# -------------------------------------------------------------------
code
startup:
Sleep(.3);
player = GetLocalPlayerThing();
ClearAdjoinFlags(crackedwall, 2);
ClearAdjoinFlags(GetSurfaceAdjoin(crackedwall), 2);
SetFaceGeoMode(crackedwall, 4);
SetFaceGeoMode(GetSurfaceAdjoin(crackedwall), 4);
bombpos = CreateThingAtPos(bomb, GetSurfaceSector(crackedwall), GetSurfaceCenter(crackedwall), VectorSet(0, 0, 0));
CaptureThing(bombpos);
return;
damaged:
if (GetCurWeapon(player) != 14) return; #if not holding MP1
if (GetParam(1) != 0x1000) return; #if damage wasn't caused by MP1
call blowitup;
return;
activated:
if (GetCurWeapon(player) == 14) return;
if(getsenderref() == crackedwall)
{
SetActorFlags(player, 0x200000);
MakeMeStop();
DeselectWeaponWait(player);
StartCutscene(0);
# ----- Set Cam Offset ---------
if (Rand() < 0.5)
{
SetExtCamOffset('0.15 -0.04 0.05');
}
else
{
SetExtCamOffset('-0.15 -0.04 0.05');
}
SetExtCamLookOffset('0.0 0.02 0.0');
PlayMode(player, 60, 0);
# player is using a wrong item
if (GetCurItem(player) >= 1)
{
sleep(0.5);
call randwrongitemlines;
}
# player isn't using anything
else
{
sleep(0.5);
speak0 = PlayVoice(player, indysay, 1.0, 1);
}
WaitForSound(speak0);
RestoreExtCam();
ClearActorFlags(player, 0x200000);
EndCutscene();
return;
}
return;
blowitup:
SetActorFlags(player, 0x200000);
MakeMeStop();
StartCutscene(0);
# ----- Set Cam Offset ---------
if (Rand() < 0.5)
{
SetExtCamOffset('0.15 -0.04 0.07');
}
else
{
SetExtCamOffset('-0.15 -0.04 0.07');
}
SetExtCamLookOffset('0.0 0.02 0.0');
sleep(0.3);
setPulse(0.01);
PlaySoundLocal(sfxCharge, 1.0, 0.0, 0x0, 0);
Sleep(1.5);
PlaySoundLocal(explosion, 1, 0, 0x0, 0);
SetAdjoinFlags(crackedwall, 2);
SetAdjoinFlags(GetSurfaceAdjoin(crackedwall), 2);
for(i=0; i<40; i=i+1)
{
fragment = CreateThing(debris, bombpos);
SetThingVel(fragment, VectorScale(VectorAdd(RandVec(), '-0.5 -0.1 0.0'), 2));
SetThingRotVel(fragment, VectorScale(VectorAdd(RandVec(), '0.0 0.0 0.0'), 900.0));
}
SetFaceGeoMode(crackedwall, 0);
SetFaceGeoMode(GetSurfaceAdjoin(crackedwall), 0);
dust=CreateThing(dusttemp,bombpos);
MaterialAnim(dustmat, 8.0, 0);
AnimateSpriteSize(dust, '0.02 0.02 1.0', '0.4 0.4 0.5', 1.0);
sleep(1.0);
setPulse(0.0);
Destroything(dust);
RestoreExtCam();
ClearActorFlags(player, 0x200000);
EndCutscene();
return;
pulse:
vibe = RandBetween(1, 4);
if (vibe == 1)
{
posOffset = '-0.005 0.00 -0.001';
angOffset = '0.00 -0.001 0.001';
}
if (vibe == 2)
{
posOffset = '0.005 -0.002 0.001';
angOffset = '0.001 0.00 -0.001';
}
if (vibe == 3)
{
posOffset = '0.002 0.002 -0.002';
angOffset = '-0.001 0.002 -0.002';
}
if (vibe == 4)
{
posOffset = '-0.001 0.00 0.002';
angOffset = '0.00 0.00 0.001';
}
vibe = RandBetween(1, 3);
if (vibe == 1)
{
SetPulse(0.05);
}
if (vibe == 2)
{
SetPulse(0.1);
}
if (vibe == 3)
{
SetPulse(0.15);
}
SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
return;
#=====================================================================
# Wrong Item lines
#=====================================================================
randwrongitemlines:
while (wi_newline == wi_oldline)
{
wi_newline = RandBetween(0, 19);
if (wi_newline < 15)
{
wi_newline = RandBetween(0, 3); # ~1/5 chance for lines 0 thru 3
}
if (wi_newline == 19)
{
wi_newline = 6; # 1/20 chance for line 6
}
if (wi_newline > 16)
{
wi_newline = 5; # 1/10 chance for line 5
}
if (wi_newline > 14)
{
wi_newline = 4; # 1/10 chance for line 4
}
}
wi_oldline = wi_newline;
lineindex = wrongitemoffset + wi_newline;
speak0 = PlayVoice(player, in_itemline0[lineindex], 1, 1);
return;
end